Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fontformat: show custom fonts only #368

Closed
wants to merge 1 commit into from

Conversation

kagenihisomi
Copy link
Contributor

Allow font format box to show only custom fonts

Setting default is to show all fonts

@kagenihisomi kagenihisomi force-pushed the dev branch 3 times, most recently from 901dcec to 757e747 Compare February 4, 2024 02:32
Copy link
Owner

@dmMaze dmMaze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review, I forgot to submit.

ui/fontformatpanel.py Show resolved Hide resolved
@@ -348,6 +362,19 @@ def on_fontfamily_changed(self):
self.apply_fontfamily()


def showPopup(self):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will "show all fonts" be applied properly? After you check and uncheck "show only custom fonts" will all fonts be listed again? I haven't run it locally but it seems there are no means to restore all fonts here. Also, it's probably not a good idea to reset the font list every time it popup, it should be updated only once when let_show_only_custom_fonts.stateChanged triggered.

@hyrulelinks
Copy link
Contributor

The advantage of only displaying custom fonts is that you can only display the fonts that need to be used, but the actual situation is that you may occasionally need to use system fonts, if you need to restart and refresh the font library every time, this seems to be inconvenient, but it is true that the current display of all fonts is really a bit too much, switching fonts is very time-consuming and laborious, and the workload can be appropriately reduced with saved font templates, but there are still some inconvenient small defects in actual use, such as font size, the font of the small dialog box suddenly becomes very large, Fine-tuning is going to take extra effort again, and there doesn't seem to be a very suitable solution at the moment

@hyrulelinks
Copy link
Contributor

hyrulelinks commented Dec 31, 2024

I pulled the above repository and ran it locally. After checking "only show custom fonts," the font menu will immediately not display system fonts. However, after unchecking, you need to close the program and rerun it for the change to take effect.

It should be noted that in order to restore the system font, you need to go to the settings, check the box, and then uncheck it, and then restart the application for it to take effect. This is because each time the application is restarted, the checkbox is set to unchecked by default, and you must click on it to reactivate it.

Although this is a bit inconvenient, it is indeed a very useful feature. After the removal of system font interference, the font list became very neat, and the efficiency improvement was obvious.

截屏2024-12-31 11 40 02

Additionally, to make the above function work on a Mac, you need to modify utils/io_utils.py:

Change NP_BOOL_TYPES = (np.bool_, np.bool8) to NP_BOOL_TYPES = (np.bool_, np.bool)

Change NP_FLOAT_TYPES = (np.float_, np.float16, np.float32, np.float64) to NP_FLOAT_TYPES = (np.float16, np.float32, np.float64)

I think it only needs to add explanatory text behind the options and fix the code above, then it can be merged into main. I believe this will be a very useful feature update.

Hope the author can consider merging.

@dmMaze @kagenihisomi

@dmMaze
Copy link
Owner

dmMaze commented Jan 2, 2025

This feature has been implemented 8a0f249

Change NP_BOOL_TYPES = (np.bool_, np.bool8) to NP_BOOL_TYPES = (np.bool_, np.bool)

Change NP_FLOAT_TYPES = (np.float_, np.float16, np.float32, np.float64) to NP_FLOAT_TYPES = (np.float16, np.float32, np.float64)

fixed by 2226a34

@dmMaze dmMaze closed this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants